package com.itheima.fanfa;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author zhangbaiyan
 * @date 2024-09-17 16:55
 * @description:
 * @version:
 */
public class test3 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("张三", 18));
        list.add(new Student("李四", 19));
        list.add(new Student("王五", 20));

        String[] array = list.stream().map(Student::getName).toArray(String[]::new);
        System.out.println(Arrays.toString(array));
    }
}
